package com.imageflowpro.image_flow_pro.controller.user;

import com.imageflowpro.image_flow_pro.po.User;
import com.imageflowpro.image_flow_pro.result.Result;
import com.imageflowpro.image_flow_pro.service.IUserService;
import com.imageflowpro.image_flow_pro.service.IVerificationCodeService;
import com.imageflowpro.image_flow_pro.vo.VerificationCodeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("userUserController")
@RequestMapping("/user")
//用户端，账号表接口
public class UserController {
    @Autowired
    private IUserService iUserService;
    @Autowired
    private IVerificationCodeService iVerificationCodeService;

    //更新个人信息
    @PostMapping("/updatePersonalInformationById")
    public Result<User> updatePersonalInformationByIdUser(@RequestBody User user){
        return Result.success(iUserService.updatePersonalInformationByIdUser(user));
    }

    //验证用户验证码
    @GetMapping("/verification/imageUpload/{code}")
    public Result<VerificationCodeVO> userImageUploadVerification(@PathVariable("code")String code){
        return Result.success(iVerificationCodeService.userImageUploadVerification(code));
    }
}
